<?php

Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
    Route::get('/login','LoginController@index')->name('admin.login');
    Route::post('/login','LoginController@doLogin')->name('admin.login');

    Route::group(['middleware'=>'checkAdminLogin'],function(){
        Route::get('/','IndexController@index')->name('admin.index');
        Route::get('/welcome','IndexController@welcome')->name('admin.welcome');

        Route::resource('category','CategoryController');
//        Route::get('/category','CategoryController@index')->name('admin.category');
//        Route::get('/categoryadd','CategoryController@add')->name('admin.categoryadd');
//        Route::post('/categoryadd','CategoryController@addPost')->name('admin.categoryadd');
//        Route::get('/categoryedit/:id','CategoryController@edit')->name('admin.categoryedit');
//        Route::post('/categoryedit','CategoryController@editPost')->name('admin.categoryedit');
//        Route::get('/categorydel','CategoryController@del')->name('admin.categorydel');

        Route::get('/article','ArticleController@index')->name('admin.article');
        Route::get('/articleadd','ArticleController@add')->name('admin.articleadd');
        Route::post('/articleadd','ArticleController@addPost')->name('admin.articleadd');
        Route::get('/articleedit','ArticleController@edit')->name('admin.articleedit');
        Route::post('/articleedit','ArticleController@editPost')->name('admin.articleedit');
        Route::get('/articledel','ArticleController@del')->name('admin.articledel');
    });
});
